﻿using FlyHorse.LIMS.BLL;
using FlyHorse.LIMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlyHorse.LIMS.WinApp.Utils.MonthReportUtils
{
    public  static class MonthReportBaseSetings
    {
        /// <summary>
        /// 获取原材料报告的检验项目
        /// </summary>
        /// <returns></returns>
        public static List<TestItem> GetRawTestItemList()
        {
            // ebo  乙烯焦油    cbo 炭黑油      cto 恩油
            //SP/Gr  比重   Moisture水分      BMCI  芳烃指数         Englar Viscosity  恩氏黏度      

            List<TestItem> testItemList = new List<TestItem>();
            TestItemBll testItemBll = new TestItemBll();
            string[] testItemIds = new string[] { "48", "49", "54", "61" };  //, "", "", "", "", ""
            for (int i = 0; i < testItemIds.Length; i++)
            {
                string id = testItemIds[i];
                TestItem testItem = testItemBll.FindEntity(id);
                if (testItem!=null)
                {
                    testItemList.Add(testItem);
                }
            }
            return testItemList;
        }

        /// <summary>
        /// 根据一个日期获得所在年份的第一天
        /// </summary>
        /// <param name="startDate"></param>
        /// <returns></returns>
        public static DateTime GetFristDaysOfYear(DateTime startDate)
        {
            int year = startDate.Year;
            DateTime fristDay = new DateTime(year, 1, 1);
            return fristDay;
        }

    }
}
